package com.jxf.demo.dto;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * 外接矩形坐标
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DXFBoundingRectangle {
    private double x;
    private double y;
    private double z;
    private double width;
    private double height;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        DXFBoundingRectangle rectangle = (DXFBoundingRectangle) o;
        return Double.compare(rectangle.x, x) == 0 && Double.compare(rectangle.y, y) == 0 && Double.compare(rectangle.z, z) == 0 && Double.compare(rectangle.width, width) == 0 && Double.compare(rectangle.height, height) == 0;
    }

    @Override
    public int hashCode() {
        return Objects.hash(x, y, z, width, height);
    }
}
